package com.tjx.controller;


import com.tjx.common.Result;
import com.tjx.entity.ParkPackage;
import com.tjx.service.IParkPackageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 套餐表 前端控制器
 * </p>
 *
 * @author tjx
 * @since 2025-10-29
 */
@RestController
@RequestMapping("/package")
public class ParkPackageController {
    @Autowired
    private IParkPackageService packageService;
     @RequestMapping("/getAll")
    public Result<List<ParkPackage>> getAll(){
         List<ParkPackage> parkPackages = packageService.getAllPackages();

         if (packageService == null) {
            return Result.fail("套餐服务未初始化",null);
        }
        return Result.ok(parkPackages);

    }

}
